/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2019-2019.
 * Description: add easy dfx hook support
 * Author: qiuguorui
 * Create: 2019-05-22
 */

#ifndef __EASY_DFX_HOOK_H
#define __EASY_DFX_HOOK_H
enum EASY_DFX_NOTIFIER_TYPE {
	EASY_DFX_USR_UNHANDLED_FAULT,
	EASY_DFX_KERNEL_DIE,
	EASY_DFX_PANIC,
	EASY_DFX_RESET,
#ifdef CONFIG_PPC
	EASY_DFX_MC_PRE,
	EASY_DFX_MC_POST,
#endif
	EASY_DFX_MAX,
};

extern int register_easy_dfx_notifier(enum EASY_DFX_NOTIFIER_TYPE type, struct notifier_block *nb);
extern int unregister_easy_dfx_notifier(enum EASY_DFX_NOTIFIER_TYPE type, struct notifier_block *nb);

/* the following call_dfx_xxx functions is only for kernel use
 * any one else should NEVER use them
 * kernel die and kernel panic use the hooks that comes with the kernel
 */
extern int call_dfx_usr_unhandled_fault_notifiers(void);

#ifdef CONFIG_PPC
extern int call_dfx_mc_pre_notifiers(void *v);
extern int call_dfx_mc_post_notifiers(void *v);
#endif
#endif /* __EASY_DFX_HOOK_H */
